str1 = 'helloWorldFjasljlasFFflasFDSsdfjal张三'
print(str1.isalpha())
str4 = '12345789一'
print(str4.isdigit())
# print(id(str1)) #id函数用来查看变量的地址
# str1 = str1.capitalize()  #一句话的首字母大写
# str1 = str1.title() #每个单词首字母大写
# str1 = str1.lower() #转换成小写
# str1 = str1.upper() #转换成大写
# str1 = str1.swapcase() # 大小写互转
# str1 = str1.strip()
# print(str1)
# print(id(str1))

# code = 'FwQ9'
#
# user_code = input(f'请输入验证码【{code}】：').strip()
#
# print(code.upper() == user_code.upper())

# str2 = 'hello'
# print(str2)
# str2 = str2.center(11,'-')
# print(str2.count('l'))  ##'l'出现了几次

s13 = "我叫sylar, 我喜欢python, java, c等编程语言."
# index = s13.index('cpython')
index = s13.find('cpython')
s13 = s13.replace('java','javaScript')
print(s13)

name = '张三'
file_name = 'test.txt'
print(name.startswith('刘'))
print(file_name.endswith('.txt'))
str = "一贰1234980"
print (str.isnumeric())

s14 = '中国'
print(s14.encode('utf-8'))
print(s14.encode('gbk'))
print(b'\xd6\xd0\xb9\xfa'.decode('gbk'))

s15 = '字符串不太友好，不太好懂，还得多练练'
lis = s15.split('，')
lis2 = ['hello', 'world','haha']
s16 = '888'.join(lis2)

print(s16)

